from common.httpRequest import Webrequests
from requests.auth import AuthBase

#appKey=OPT_WEB&orgId=1&partJobId=161396&listType=1
# 商家web端登录
class PartJobDetailUnchecked:
    def __init__(self,token,partJobId,appKey='OPT_WEB',orgId='1',listType='2'):
        self.token =token
        self.partJobId = partJobId #兼职岗位分类
        self.appKey = appKey #兼职标题
        self.orgId =orgId #扩展报名人数
        self.listType = listType  #兼职描述

    def do_partJobDetailUnchecked(self):
        url = "https://test-api.qtshe.com/jobCenter/yyWeb/partJob/detail/unchecked"
        headers = {'Content-Type': 'application/json;charset=UTF-8', 'Authorization': self.token}
        param = {
            'appKey': str(self.appKey),
            'orgId': str(self.orgId),
            'partJobId': str(self.partJobId),
            'listType': str(self.listType)
        }
        try:
           r = Webrequests(url, param, headers).post()
           if r.status_code == 200:
               print("登录成功")
               print("参数:"+str(param))

               return r
        except Exception as e:
            print("登录失败")


